<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>闲置换钱 - 闲置交易平台</title>
  <script src="https://cdn.tailwindcss.com"></script>
  <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
  
  <!-- Tailwind配置 -->
  <script>
    tailwind.config = {
      theme: {
        extend: {
          colors: {
            primary: '#FF5E5E',
            secondary: '#FFB800',
            neutral: '#F5F5F5',
            dark: '#333333',
            light: '#F9F9F9',
            gray: {
              100: '#F5F5F5',
              200: '#E5E5E5',
              300: '#D4D4D4',
              400: '#A3A3A3',
              500: '#737373',
              600: '#525252',
              700: '#404040',
              800: '#262626',
              900: '#171717',
            }
          },
          fontFamily: {
            sans: ['PingFang SC', 'Helvetica Neue', 'Arial', 'sans-serif'],
          },
        },
      }
    }
  </script>
  
  <style type="text/tailwindcss">
    @layer utilities {
      .content-auto {
        content-visibility: auto;
      }
      .scrollbar-hide {
        -ms-overflow-style: none;
        scrollbar-width: none;
      }
      .scrollbar-hide::-webkit-scrollbar {
        display: none;
      }
      .tab-active {
        color: theme('colors.primary');
        border-bottom-color: theme('colors.primary');
      }
      .product-card-shadow {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
      }
      .btn-hover-effect {
        transition: all 0.2s ease;
      }
      .btn-hover-effect:hover {
        transform: translateY(-2px);
      }
    }
  </style>
</head>

<body class="bg-gray-100 font-sans text-dark">
  <!-- 导航栏 -->
  <header class="fixed top-0 left-0 right-0 bg-white z-50 shadow-sm transition-all duration-300" id="main-header">
    <div class="container mx-auto px-4 py-3 flex items-center justify-between">
      <div class="flex items-center space-x-2">
        <div class="text-primary text-2xl font-bold">闲置换钱</div>
      </div>
      
      <div class="relative w-1/2">
        <input type="text" placeholder="搜索闲置好物" 
               class="w-full pl-10 pr-4 py-2 rounded-full bg-gray-100 text-sm focus:outline-none focus:ring-2 focus:ring-primary/30 transition-all">
        <i class="fa fa-search absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"></i>
      </div>
      
      <div class="flex items-center space-x-4">
        <button class="text-gray-600 hover:text-primary transition-colors">
          <i class="fa fa-camera text-xl"></i>
        </button>
        <button class="text-gray-600 hover:text-primary transition-colors relative">
          <i class="fa fa-bell text-xl"></i>
          <span class="absolute -top-1 -right-1 bg-primary text-white text-xs rounded-full w-4 h-4 flex items-center justify-center">3</span>
        </button>
      </div>
    </div>
  </header>

  <!-- 主内容区 -->
  <main class="pt-16 pb-16 min-h-screen">
    <!-- 轮播图 -->
    <div class="relative overflow-hidden">
      <div class="flex transition-transform duration-500 ease-in-out" id="carousel">
        <div class="w-full flex-shrink-0">
          <img src="https://picsum.photos/800/300?random=1" alt="夏日清凉特卖" class="w-full h-40 object-cover">
        </div>
        <div class="w-full flex-shrink-0">
          <img src="https://picsum.photos/800/300?random=2" alt="数码产品专场" class="w-full h-40 object-cover">
        </div>
        <div class="w-full flex-shrink-0">
          <img src="https://picsum.photos/800/300?random=3" alt="服装鞋包专区" class="w-full h-40 object-cover">
        </div>
      </div>
      <div class="absolute bottom-3 left-1/2 transform -translate-x-1/2 flex space-x-2">
        <button class="w-2 h-2 rounded-full bg-white opacity-50 carousel-dot active"></button>
        <button class="w-2 h-2 rounded-full bg-white opacity-50 carousel-dot"></button>
        <button class="w-2 h-2 rounded-full bg-white opacity-50 carousel-dot"></button>
      </div>
    </div>

    <!-- 分类导航 -->
    <div class="bg-white p-4 grid grid-cols-5 gap-4 mb-4">
      <div class="flex flex-col items-center">
        <div class="w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center text-primary">
          <i class="fa fa-laptop text-xl"></i>
        </div>
        <span class="text-xs mt-2">数码</span>
      </div>
      <div class="flex flex-col items-center">
        <div class="w-12 h-12 rounded-full bg-secondary/10 flex items-center justify-center text-secondary">
          <i class="fa fa-shopping-bag text-xl"></i>
        </div>
        <span class="text-xs mt-2">服装</span>
      </div>
      <div class="flex flex-col items-center">
        <div class="w-12 h-12 rounded-full bg-green-100 flex items-center justify-center text-green-500">
          <i class="fa fa-book text-xl"></i>
        </div>
        <span class="text-xs mt-2">书籍</span>
      </div>
      <div class="flex flex-col items-center">
        <div class="w-12 h-12 rounded-full bg-blue-100 flex items-center justify-center text-blue-500">
          <i class="fa fa-gamepad text-xl"></i>
        </div>
        <span class="text-xs mt-2">游戏</span>
      </div>
      <div class="flex flex-col items-center">
        <div class="w-12 h-12 rounded-full bg-purple-100 flex items-center justify-center text-purple-500">
          <i class="fa fa-plus text-xl"></i>
        </div>
        <span class="text-xs mt-2">更多</span>
      </div>
    </div>

    <!-- 热门推荐 -->
    <div class="bg-white p-4 mb-4">
      <div class="flex justify-between items-center mb-4">
        <h2 class="font-bold text-lg">热门推荐</h2>
        <a href="#" class="text-gray-500 text-sm">查看更多</a>
      </div>
      
      <div class="grid grid-cols-2 gap-4">
        <!-- 商品卡片1 -->
        <div class="bg-white rounded-lg overflow-hidden product-card-shadow hover:shadow-md transition-shadow">
          <div class="relative">
            <img src="https://picsum.photos/400/300?random=10" alt="小米10手机" class="w-full h-48 object-cover">
            <div class="absolute top-2 left-2 bg-primary/90 text-white text-xs px-2 py-1 rounded">
              超值
            </div>
          </div>
          <div class="p-3">
            <h3 class="font-medium text-sm mb-1 line-clamp-2">小米10 8+128G 蓝色 95新 自用手机</h3>
            <div class="flex justify-between items-center mt-2">
              <span class="text-primary font-bold">¥1899</span>
              <span class="text-gray-400 text-xs">距离1.2km</span>
            </div>
            <div class="flex justify-between items-center mt-1">
              <div class="flex items-center">
                <img src="https://picsum.photos/20/20?random=100" alt="用户头像" class="w-4 h-4 rounded-full">
                <span class="text-xs text-gray-500 ml-1">小米爱好者</span>
              </div>
              <span class="text-xs text-gray-400">1小时前</span>
            </div>
          </div>
        </div>
        
        <!-- 商品卡片2 -->
        <div class="bg-white rounded-lg overflow-hidden product-card-shadow hover:shadow-md transition-shadow">
          <div class="relative">
            <img src="https://picsum.photos/400/300?random=11" alt="苹果MacBook" class="w-full h-48 object-cover">
            <div class="absolute top-2 left-2 bg-secondary/90 text-white text-xs px-2 py-1 rounded">
              包邮
            </div>
          </div>
          <div class="p-3">
            <h3 class="font-medium text-sm mb-1 line-clamp-2">2017款 MacBook Pro 13.3 银色 轻度使用</h3>
            <div class="flex justify-between items-center mt-2">
              <span class="text-primary font-bold">¥4599</span>
              <span class="text-gray-400 text-xs">距离2.5km</span>
            </div>
            <div class="flex justify-between items-center mt-1">
              <div class="flex items-center">
                <img src="https://picsum.photos/20/20?random=101" alt="用户头像" class="w-4 h-4 rounded-full">
                <span class="text-xs text-gray-500 ml-1">数码玩家</span>
              </div>
              <span class="text-xs text-gray-400">3小时前</span>
            </div>
          </div>
        </div>
        
        <!-- 商品卡片3 -->
        <div class="bg-white rounded-lg overflow-hidden product-card-shadow hover:shadow-md transition-shadow">
          <div class="relative">
            <img src="https://picsum.photos/400/300?random=12" alt="耐克运动鞋" class="w-full h-48 object-cover">
          </div>
          <div class="p-3">
            <h3 class="font-medium text-sm mb-1 line-clamp-2">耐克 Air Max 97 运动鞋 42码 仅试穿</h3>
            <div class="flex justify-between items-center mt-2">
              <span class="text-primary font-bold">¥599</span>
              <span class="text-gray-400 text-xs">距离3.7km</span>
            </div>
            <div class="flex justify-between items-center mt-1">
              <div class="flex items-center">
                <img src="https://picsum.photos/20/20?random=102" alt="用户头像" class="w-4 h-4 rounded-full">
                <span class="text-xs text-gray-500 ml-1">运动达人</span>
              </div>
              <span class="text-xs text-gray-400">5小时前</span>
            </div>
          </div>
        </div>
        
        <!-- 商品卡片4 -->
        <div class="bg-white rounded-lg overflow-hidden product-card-shadow hover:shadow-md transition-shadow">
          <div class="relative">
            <img src="https://picsum.photos/400/300?random=13" alt="专业相机" class="w-full h-48 object-cover">
            <div class="absolute top-2 left-2 bg-green-500/90 text-white text-xs px-2 py-1 rounded">
              降价
            </div>
          </div>
          <div class="p-3">
            <h3 class="font-medium text-sm mb-1 line-clamp-2">佳能 EOS 80D 单反相机 套机 几乎全新</h3>
            <div class="flex justify-between items-center mt-2">
              <span class="text-primary font-bold">¥4299</span>
              <span class="text-gray-400 text-xs">距离5.1km</span>
            </div>
            <div class="flex justify-between items-center mt-1">
              <div class="flex items-center">
                <img src="https://picsum.photos/20/20?random=103" alt="用户头像" class="w-4 h-4 rounded-full">
                <span class="text-xs text-gray-500 ml-1">摄影师小李</span>
              </div>
              <span class="text-xs text-gray-400">昨天</span>
            </div>
          </div>
        </div>
      </div>
    </div>

    <!-- 附近的人 -->
    <div class="bg-white p-4 mb-4">
      <div class="flex justify-between items-center mb-4">
        <h2 class="font-bold text-lg">附近的闲置</h2>
        <a href="#" class="text-gray-500 text-sm">切换位置</a>
      </div>
      
      <div class="space-y-4">
        <!-- 附近用户1 -->
        <div class="flex items-start space-x-3">
          <img src="https://picsum.photos/50/50?random=200" alt="用户头像" class="w-12 h-12 rounded-full object-cover">
          <div class="flex-1">
            <div class="flex justify-between">
              <h3 class="font-medium">小陈同学</h3>
              <span class="text-xs text-gray-400">距离800米</span>
            </div>
            <p class="text-sm text-gray-600 mt-1">出闲置书籍，都是考研资料，几乎全新</p>
            <div class="flex space-x-2 mt-2">
              <img src="https://picsum.photos/100/100?random=210" alt="闲置书籍" class="w-16 h-16 object-cover rounded">
              <img src="https://picsum.photos/100/100?random=211" alt="闲置书籍" class="w-16 h-16 object-cover rounded">
              <img src="https://picsum.photos/100/100?random=212" alt="闲置书籍" class="w-16 h-16 object-cover rounded">
            </div>
            <div class="flex justify-between items-center mt-2">
              <div class="flex space-x-3">
                <button class="flex items-center text-gray-500 text-xs">
                  <i class="fa fa-heart-o mr-1"></i> 喜欢
                </button>
                <button class="flex items-center text-gray-500 text-xs">
                  <i class="fa fa-comment-o mr-1"></i> 评论
                </button>
              </div>
              <span class="text-primary font-medium">¥150</span>
            </div>
          </div>
        </div>
        
        <!-- 附近用户2 -->
        <div class="flex items-start space-x-3">
          <img src="https://picsum.photos/50/50?random=201" alt="用户头像" class="w-12 h-12 rounded-full object-cover">
          <div class="flex-1">
            <div class="flex justify-between">
              <h3 class="font-medium">小王学长</h3>
              <span class="text-xs text-gray-400">距离1.5公里</span>
            </div>
            <p class="text-sm text-gray-600 mt-1">毕业了，出一台笔记本电脑，联想小新Pro14</p>
            <div class="flex space-x-2 mt-2">
              <img src="https://picsum.photos/100/100?random=220" alt="笔记本电脑" class="w-16 h-16 object-cover rounded">
              <img src="https://picsum.photos/100/100?random=221" alt="笔记本电脑" class="w-16 h-16 object-cover rounded">
            </div>
            <div class="flex justify-between items-center mt-2">
              <div class="flex space-x-3">
                <button class="flex items-center text-gray-500 text-xs">
                  <i class="fa fa-heart-o mr-1"></i> 喜欢
                </button>
                <button class="flex items-center text-gray-500 text-xs">
                  <i class="fa fa-comment-o mr-1"></i> 评论
                </button>
              </div>
              <span class="text-primary font-medium">¥3200</span>
            </div>
          </div>
        </div>
      </div>
    </div>
  </main>

  <!-- 底部导航 -->
  <footer class="fixed bottom-0 left-0 right-0 bg-white border-t border-gray-200 py-2 z-40">
    <div class="container mx-auto px-4">
      <div class="flex justify-around">
        <a href="#" class="flex flex-col items-center text-primary">
          <i class="fa fa-home text-xl"></i>
          <span class="text-xs mt-1">首页</span>
        </a>
        <a href="#" class="flex flex-col items-center text-gray-500">
          <i class="fa fa-compass text-xl"></i>
          <span class="text-xs mt-1">发现</span>
        </a>
        <a href="#" class="flex flex-col items-center text-gray-500">
          <div class="w-12 h-12 rounded-full bg-primary flex items-center justify-center -mt-4">
            <i class="fa fa-plus text-white text-xl"></i>
          </div>
        </a>
        <a href="#" class="flex flex-col items-center text-gray-500">
          <i class="fa fa-bell text-xl"></i>
          <span class="text-xs mt-1">消息</span>
        </a>
        <a href="#" class="flex flex-col items-center text-gray-500">
          <i class="fa fa-user-o text-xl"></i>
          <span class="text-xs mt-1">我的</span>
        </a>
      </div>
    </div>
  </footer>

  <!-- 商品详情模态框 -->
  <div id="product-modal" class="fixed inset-0 bg-black/50 z-50 hidden flex items-center justify-center">
    <div class="bg-white rounded-t-lg max-w-md w-full max-h-[90vh] overflow-y-auto">
      <div class="relative">
        <img src="https://picsum.photos/800/600?random=300" alt="商品大图" class="w-full h-72 object-cover">
        <button class="absolute top-4 right-4 bg-black/30 text-white w-8 h-8 rounded-full flex items-center justify-center" id="close-modal">
          <i class="fa fa-times"></i>
        </button>
      </div>
      <div class="p-5">
        <h2 class="font-bold text-xl mb-2">小米10 8+128G 蓝色 95新 自用手机</h2>
        <div class="flex items-center mb-4">
          <span class="text-primary text-2xl font-bold">¥1899</span>
          <span class="text-gray-400 line-through text-sm ml-2">¥2999</span>
        </div>
        
        <div class="flex items-center justify-between mb-4">
          <div class="flex items-center">
            <img src="https://picsum.photos/40/40?random=310" alt="卖家头像" class="w-10 h-10 rounded-full">
            <div class="ml-2">
              <h3 class="font-medium">小米爱好者</h3>
              <div class="flex items-center text-xs text-gray-500">
                <i class="fa fa-map-marker mr-1"></i>
                <span>杭州市 · 距离1.2km</span>
              </div>
            </div>
          </div>
          <button class="border border-primary text-primary px-3 py-1 rounded-full text-sm">关注</button>
        </div>
        
        <div class="border-t border-b border-gray-200 py-4 mb-4">
          <h3 class="font-medium mb-2">商品描述</h3>
          <p class="text-gray-600 text-sm">自用小米10手机，蓝色，8+128G，95新，无拆无修，功能完好，外观轻微使用痕迹，送原装充电器和手机壳。</p>
        </div>
        
        <div class="grid grid-cols-2 gap-3 mb-4">
          <div class="bg-gray-100 rounded-lg p-3">
            <h4 class="text-gray-500 text-xs mb-1">发布时间</h4>
            <p class="text-sm">1小时前</p>
          </div>
          <div class="bg-gray-100 rounded-lg p-3">
            <h4 class="text-gray-500 text-xs mb-1">浏览次数</h4>
            <p class="text-sm">238次</p>
          </div>
        </div>
        
        <div class="flex space-x-3">
          <button class="flex-1 bg-primary text-white py-3 rounded-lg font-medium btn-hover-effect">
            立即购买
          </button>
          <button class="w-12 h-12 border border-gray-300 rounded-lg flex items-center justify-center text-gray-500">
            <i class="fa fa-shopping-cart"></i>
          </button>
        </div>
      </div>
    </div>
  </div>

  <!-- 分类页面 (默认隐藏) -->
  <div id="category-page" class="fixed inset-0 bg-white z-50 transform translate-x-full transition-transform duration-300">
    <div class="flex items-center justify-between p-4 border-b">
      <button id="close-category" class="text-gray-500">
        <i class="fa fa-arrow-left"></i>
      </button>
      <h2 class="font-bold text-lg">全部分类</h2>
      <div class="w-6"></div>
    </div>
    
    <div class="grid grid-cols-3 gap-4 p-4">
      <div class="flex flex-col items-center p-3 rounded-lg bg-gray-100">
        <div class="w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center text-primary mb-2">
          <i class="fa fa-laptop text-xl"></i>
        </div>
        <span class="text-sm">数码</span>
      </div>
      <div class="flex flex-col items-center p-3 rounded-lg bg-gray-100">
        <div class="w-12 h-12 rounded-full bg-secondary/10 flex items-center justify-center text-secondary mb-2">
          <i class="fa fa-shopping-bag text-xl"></i>
        </div>
        <span class="text-sm">服装</span>
      </div>
      <div class="flex flex-col items-center p-3 rounded-lg bg-gray-100">
        <div class="w-12 h-12 rounded-full bg-green-100 flex items-center justify-center text-green-500 mb-2">
          <i class="fa fa-book text-xl"></i>
        </div>
        <span class="text-sm">书籍</span>
      </div>
      <div class="flex flex-col items-center p-3 rounded-lg bg-gray-100">
        <div class="w-12 h-12 rounded-full bg-blue-100 flex items-center justify-center text-blue-500 mb-2">
          <i class="fa fa-gamepad text-xl"></i>
        </div>
        <span class="text-sm">游戏</span>
      </div>
      <div class="flex flex-col items-center p-3 rounded-lg bg-gray-100">
        <div class="w-12 h-12 rounded-full bg-purple-100 flex items-center justify-center text-purple-500 mb-2">
          <i class="fa fa-car text-xl"></i>
        </div>
        <span class="text-sm">汽车</span>
      </div>
      <div class="flex flex-col items-center p-3 rounded-lg bg-gray-100">
        <div class="w-12 h-12 rounded-full bg-red-100 flex items-center justify-center text-red-500 mb-2">
          <i class="fa fa-home text-xl"></i>
        </div>
        <span class="text-sm">家居</span>
      </div>
      <div class="flex flex-col items-center p-3 rounded-lg bg-gray-100">
        <div class="w-12 h-12 rounded-full bg-yellow-100 flex items-center justify-center text-yellow-500 mb-2">
          <i class="fa fa-bicycle text-xl"></i>
        </div>
        <span class="text-sm">交通工具</span>
      </div>
      <div class="flex flex-col items-center p-3 rounded-lg bg-gray-100">
        <div class="w-12 h-12 rounded-full bg-pink-100 flex items-center justify-center text-pink-500 mb-2">
          <i class="fa fa-gift text-xl"></i>
        </div>
        <span class="text-sm">礼品</span>
      </div>
      <div class="flex flex-col items-center p-3 rounded-lg bg-gray-100">
        <div class="w-12 h-12 rounded-full bg-teal-100 flex items-center justify-center text-teal-500 mb-2">
          <i class="fa fa-plus text-xl"></i>
        </div>
        <span class="text-sm">更多</span>
      </div>
    </div>
  </div>

  <script>
    // 轮播图功能
    const carousel = document.getElementById('carousel');
    const dots = document.querySelectorAll('.carousel-dot');
    let currentSlide = 0;
    const slideCount = document.querySelectorAll('#carousel > div').length;
    
    function showSlide(index) {
      carousel.style.transform = `translateX(-${index * 100}%)`;
      dots.forEach((dot, i) => {
        dot.classList.toggle('opacity-100', i === index);
        dot.classList.toggle('opacity-50', i !== index);
      });
      currentSlide = index;
    }
    
    dots.forEach((dot, index) => {
      dot.addEventListener('click', () => showSlide(index));
    });
    
    // 自动轮播
    setInterval(() => {
      let nextSlide = (currentSlide + 1) % slideCount;
      showSlide(nextSlide);
    }, 3000);
    
    // 商品详情模态框
    const productModal = document.getElementById('product-modal');
    const closeModal = document.getElementById('close-modal');
    const productCards = document.querySelectorAll('.product-card-shadow');
    
    productCards.forEach(card => {
      card.addEventListener('click', () => {
        productModal.classList.remove('hidden');
        document.body.style.overflow = 'hidden';
      });
    });
    
    closeModal.addEventListener('click', () => {
      productModal.classList.add('hidden');
      document.body.style.overflow = '';
    });
    
    // 分类页面
    const categoryPage = document.getElementById('category-page');
    const categoryIcon = document.querySelector('.fa-compass').parentElement;
    const closeCategory = document.getElementById('close-category');
    
    categoryIcon.addEventListener('click', () => {
      categoryPage.classList.remove('translate-x-full');
      document.body.style.overflow = 'hidden';
    });
    
    closeCategory.addEventListener('click', () => {
      categoryPage.classList.add('translate-x-full');
      document.body.style.overflow = '';
    });
    
    // 滚动时导航栏效果
    const header = document.getElementById('main-header');
    window.addEventListener('scroll', () => {
      if (window.scrollY > 10) {
        header.classList.add('shadow');
      } else {
        header.classList.remove('shadow');
      }
    });
  </script>
</body>
</html>
    